
// ChildView.h : interface of the CChildView class
//


#pragma once

#include "graphics/OpenGLWnd.h"
#include "graphics/GrCamera.h"
#include "SgComposite.h"
#include "Timeline.h"

#include "ScrambledEggsFactory.h"
#include "RoundUpFactory.h"
#include "GoCartFactory.h"
#include "EnvironmentFactory.h"
#include "PirateShipFactory.h"
#include "ScrambledEggsFactory.h"
#include "MerryRoundFactory.h"
#include "GoCartFactory.h"



// CChildView window

class CChildView : public COpenGLWnd
{
// Construction
public:
	CChildView();

// Attributes
public:

// Operations
public:

// Overrides
	protected:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);

// Implementation
public:
	virtual ~CChildView();

	// Generated message map functions
protected:

	DECLARE_MESSAGE_MAP()
public:
	void OnGLDraw(CDC * pDC);
	void DrawStar(CDC * pDC);
	void Box(GLdouble p_x, GLdouble p_y, GLdouble p_z, const GLdouble *p_color);
	void BarBell();

private:
	double m_starx;
	double m_stary;
	double m_starradius;
	double m_starrotation;

	int m_red;
	int m_green;
	int m_blue;

	double m_spinAngle;
	UINT_PTR m_spinTimer;

    CGrCamera m_camera;

	CEnvironmentFactory *m_environment;
	CRoundUpFactory *m_roundUp;
	CScrambledEggsFactory * m_scrams;
	CMerryRoundFactory *m_round;
	CPirateShipFactory *m_pirateShip;
	CGoCartFactory *m_goCart;

	CSgComposite *m_park;

	CTimeline m_timeline;

public:
	afx_msg void OnMovementSpin();
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnCameraPan();
	afx_msg void OnUpdateCameraPan(CCmdUI *pCmdUI);
	afx_msg void OnCameraPitch();
	afx_msg void OnUpdateCameraPitch(CCmdUI *pCmdUI);
	afx_msg void OnCameraRollMove();
	afx_msg void OnUpdateCameraRollMove(CCmdUI *pCmdUI);
	afx_msg void OnCameraDolly();
	afx_msg void OnUpdateCameraDolly(CCmdUI *pCmdUI);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags );
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);

};

